namespace RetailAnalytic.Tools.MGrouping
{
    using System;
    using System.Data.SqlClient;

    public class GroupingData
    {
        public GroupingData(SqlConnection sqlConnection, string name)
        {
            this.name = name;
            string text1 = "select SourceTable, GroupTable, LinkColumn, ItemName, ItemId, ValTable from Groupings where Name = '" + name + "'";
            SqlDataReader reader1 = new SqlCommand(text1, sqlConnection).ExecuteReader();
            reader1.Read();
            this.sourceTable = (string) reader1.GetValue(0);
            this.groupTable = (string) reader1.GetValue(1);
            this.linkColumn = (string) reader1.GetValue(2);
            this.itemName = (string) reader1.GetValue(3);
            this.itemId = (string) reader1.GetValue(4);
            if (reader1.IsDBNull(5))
            {
                this.valTable = null;
            }
            else
            {
                this.valTable = (string) reader1.GetValue(5);
            }
            reader1.Close();
        }


        public string groupTable;
        public string itemId;
        public string itemName;
        public string linkColumn;
        public string name;
        public string sourceTable;
        public string valTable;
    }
}

